Expand description
This crate provides a fast conversion of byte arrays to hexadecimal strings, both at compile time, and at run time.
It aims to be a drop-in replacement for the hex
crate, as well as
extending the API with const-eval, a
const-generics formatting buffer, similar to itoa
’s, and more.
Version requirement: rustc 1.64+
Re-exports§
pub use traits::ToHexExt;
alloc
pub use self::serde::deserialize;
pub use self::serde::serialize;
alloc
pub use self::serde::serialize_upper;
alloc
pub use hex;
Modules§
- Hex encoding with
serde
. - Modified from
hex
.
Structs§
- A correctly sized stack allocation for the formatted bytes to be written into.
Enums§
- The error type for decoding a hex string into
Vec<u8>
or[u8; N]
.
Constants§
- The table of lowercase characters used for hex encoding.
- The table of uppercase characters used for hex encoding.
- The lookup table of hex byte to value, used for hex decoding.
- Represents an invalid value in the
HEX_DECODE_LUT
table.
Traits§
- Types that can be decoded from a hex string.
- Encoding values as hex string.
Functions§
- Returns
true
if the input is a valid hex string and can be decoded successfully. - Returns
true
if the input is a valid hex string. - Returns
true
if the input is a valid hex string and can be decoded successfully. - Returns
true
if the input is a valid hex string. - Decode a hex string into a fixed-length byte-array.
- Encodes
input
as a hex string into aBuffer
. - decode
alloc
Decodes a hex string into raw bytes. - Decode a hex string into a fixed-length byte-array.
- Decode a hex string into a mutable bytes slice.
- encode
alloc
Encodesdata
as a hex string using lowercase characters. - encode_
prefixed alloc
Encodesdata
as a prefixed hex string using lowercase characters. - Encodes
input
as a hex string using lowercase characters into a mutable slice of bytesoutput
. - Encodes
input
as a hex string using uppercase characters into a mutable slice of bytesoutput
. - encode_
upper alloc
Encodesdata
as a hex string using uppercase characters. - Encodes
data
as a prefixed hex string using uppercase characters.